package com.task.dao.impl;

import com.task.dao.ArticleDao;
import com.task.domain.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository("articleDao")
public class ArticleDaoImpl implements ArticleDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public void save(Article article) {
        System.out.println("底层dao正在插入文章");
        String sql = "insert into t_article(title,content) values(?,?)";
        jdbcTemplate.update(sql,article.getTitle(),article.getContent());
//        int i=1/0;
    }
}
